package com.itheima.controller;

import com.itheima.pojo.User;
import org.springframework.web.bind.annotation.*;

@RestController
public class ParameterController{
    @RequestMapping("/simpleParam")
    public String simpleParam(String name ,Integer age){
        System.out.println(name+" : "+age);
        return "OK ~";
    }
    @RequestMapping("/complexPojo")
    public String simpleParam(@RequestParam("user") User userName){
        System.out.println(userName);
        return "OK ~";
    }

    @RequestMapping("/jsonParam")
    public String jsonParam(@RequestBody User user){
        System.out.println(user);
        return "OK ~";
    }

    @RequestMapping("/parameter11/{id}/{name}/{city}/{age}/{height}")
    public String parameter11(@PathVariable Integer id,
                              @PathVariable String name,
                              @PathVariable String city,
                              @PathVariable Integer age,
                              @PathVariable Double height){
        System.out.println(id+ " : " +name+ " : " +city+ " : " +age+ " : " +height);
        return "OK ~";
    }
}
